<template>
  <div class="pro-bottom">
    <div class="info-box" v-for="(data,index) in dafaultData" @click="nextPage(data.index)" :key='index'
      :class="[data.sum == '0'?'boxwrite':'boxred']">
      <div class="p-title">{{data.category}}</div>
      <div class="p-state">累计时间：{{data.totleTime}}min</div>
      <div class="p-state" v-if="data.sum == '0'">当前状态：无异常</div>
      <div class="p-state" v-if="data.sum != '0'">当前状态：<span>异常</span></div>
    </div>
  </div> 
</template>

<script>
  export default{
    name:'StatuList',
    props:{
      dafaultData:{
        type:Array,
        default() {
          return []
        }
      }
    },
    methods:{
      nextPage(index) {
        this.$router.push('/pro-list/' + index);
      }
    }
  }
</script>

<style scoped lang="less">
  .boxred {
    background-color: #F29494;
  }
  .boxwrite {
    background-color: #C0D8F2;
  }
  .pro-bottom {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 50px;
    .info-box {
      box-sizing: border-box;
      width: 33.33%;
      padding-bottom: 0.64rem;
      text-align: center;
      border: 0.056rem solid #FFFFFF;
      .p-state {
        color: #555555;
        font-size: 0.3rem;
        margin-top: 0.64rem;
        span {
          color: #D9001B;
          font-weight: bold;
        }
      }
      .p-title {
        color: #333333;
        font-size: 0.37rem;
        margin-top: 0.6rem;
      }
    }
  }
</style>
